const state = {
  relativeData: {}, // 亲属关系
  friendData: {}, // 社会关系
  accompanyData: [], // 多次伴随
  traceData: {}, // 轨迹
  otherData: [], // 其他线索
  otherFlag: '', // 统一详情标识
  allTrackData: [], // 所有轨迹
  carData: {}, // 车辆轨迹
  name: '',
  img: '',
  carImg: '',
  carBase: {}
}

const mutations = {
  gethomeDetail (state, data) {
    state.relativeData = data
  },
  getfriendDetail (state, data) {
    state.friendData = data
  },
  getaccompanyData (state, data) {
    state.accompanyData = data
  },
  gettraceDetail (state, data) {
    state.traceData = data
  },
  getotherDetail (state, data) {
    state.otherData = data
  },
  getotherFlag (state, data) {
    state.otherFlag = data
  },
  getallTrackDetail (state, data) {
    state.allTrackData = data
  },
  getcarDetail (state, data) {
    state.carData = data
  },
  getName (state, data) {
    state.name = data
  },
  getImage (state, data) {
    state.img = data
  },
  getCarImage (state, data) {
    state.carImg = data
  },
  getCarBase (state, data) {
    state.carBase = data
  }
}

const actions = {
  gethomeDetail ({commit, state}, data) {
    commit('gethomeDetail', data)
  },
  getfriendDetail ({commit, state}, data) {
    commit('getfriendDetail', data)
  },
  getaccompanyData ({commit, state}, data) {
    commit('getaccompanyData', data)
  },
  gettraceDetail ({commit, state}, data) {
    commit('gettraceDetail', data)
  },
  getotherDetail ({commit, state}, data) {
    commit('getotherDetail', data)
  },
  getotherFlag ({commit, state}, data) {
    commit('getotherFlag', data)
  },
  getallTrackDetail ({commit, state}, data) {
    commit('getallTrackDetail', data)
  },
  getcarDetail ({commit, state}, data) {
    commit('getcarDetail', data)
  },
  getName ({commit, state}, data) {
    commit('getName', data)
  },
  getImage ({commit, state}, data) {
    commit('getImage', data)
  },
  getCarImage ({commit, state}, data) {
    commit('getCarImage', data)
  },
  getCarBase ({commit, state}, data) {
    commit('getCarBase', data)
  }
}

const personStore = {
  namespaced: true, // 给此模块添加命名空间
  state: state,
  mutations: mutations, // 添加了命名空间后 mutation 中的方法可以通过 “模块名/方法” 来获取 如：dispatch('sample/fn')
  actions: actions   // 添加了命名空间,可以通过 “模块名/方法” 来获取 如：commit('sample/fn')
  // getters:getters    // 添加了命名空间,可以通过 “模块名/getter” 来获取 如：getters('sample/getter')
}

export default personStore
